home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / rayshade / include / rle_raw.h < prev    next >
C/C++ Source or Header  |  1995-01-12  |  3KB  |  116 lines

  1. /*
  2.  * This software is copyrighted as noted below.  It may be freely copied,
  3.  * modified, and redistributed, provided that the copyright notice is 
  4.  * preserved on all copies.
  5.  * 
  6.  * There is no warranty or other guarantee of fitness for this software,
  7.  * it is provided solely "as is".  Bug reports or fixes may be sent
  8.  * to the author, who may or may not act on them as he desires.
  9.  *
  10.  * You may not include this software in a program or other software product
  11.  * without supplying the source, or without informing the end-user that the 
  12.  * source is available for no extra charge.
  13.  *
  14.  * If you modify this software, you should include a notice giving the
  15.  * name of the person performing the modification, the date of modification,
  16.  * and the reason for such modification.
  17.  */
  18. /* 
  19.  * rle_raw.h - Definitions for rle_getraw/rle_putraw.
  20.  * 
  21.  * Author:    Spencer W. Thomas
  22.  *         Computer Science Dept.
  23.  *         University of Utah
  24.  * Date:    Mon Jul  7 1986
  25.  * Copyright (c) 1986, Spencer W. Thomas
  26.  */
  27.  
  28. #ifndef RLE_RAW_H
  29. #define RLE_RAW_H
  30.  
  31. #include <rle_code.h>
  32.  
  33. /*****************************************************************
  34.  * TAG( rle_op )
  35.  *
  36.  * Struct representing one rle opcode.
  37.  */
  38. #ifndef c_plusplus
  39.     typedef struct rle_op rle_op;
  40. #endif
  41.  
  42. struct rle_op {
  43.     int opcode;            /* one of RByteDataOp or RRunDataOp */
  44.     int xloc;            /* X location this op starts at */
  45.     int length;            /* length of run or data */
  46.     union {
  47.     rle_pixel * pixels;    /* for ByteData */
  48.     int run_val;        /* for RunData */
  49.     } u;
  50. };
  51.  
  52. #ifdef USE_PROTOTYPES
  53.     /*****************************************************************
  54.      * TAG( rle_raw_alloc )
  55.      * 
  56.      * Allocate buffer space for use by rle_getraw and rle_putraw.
  57.      */
  58.     extern int
  59.     rle_raw_alloc( rle_hdr *the_hdr, rle_op ***scanp, int **nrawp );
  60.  
  61.     /*****************************************************************
  62.      * TAG( rle_raw_free )
  63.      *
  64.      * Free buffer space allocated by rle_raw_alloc.
  65.      */
  66.     extern void rle_raw_free( rle_hdr *the_hdr, rle_op **scanp, int *nrawp );
  67.  
  68.     /*****************************************************************
  69.      * TAG( rle_getraw )
  70.      * 
  71.      * Get a raw scanline from the input file.
  72.      */
  73.     extern unsigned int
  74.     rle_getraw( rle_hdr *the_hdr, rle_op *scanraw[], int nraw[] );
  75.  
  76.     /*****************************************************************
  77.      * TAG( rle_freeraw )
  78.      * 
  79.      * Free all the pixel arrays in the raw scan struct.
  80.      */
  81.     extern void
  82.     rle_freeraw( rle_hdr * the_hdr, rle_op *scanraw[], int nraw[] );
  83.  
  84.     /*****************************************************************
  85.      * TAG( rle_putraw )
  86.      *
  87.      * Put raw scanline data to the output file.
  88.      */
  89.     extern void
  90.     rle_putraw( rle_op **scanraw, int *nraw, rle_hdr *the_hdr );
  91.  
  92.     /*****************************************************************
  93.      * TAG( rle_rawtorow )
  94.      *
  95.      * Convert raw data to "row" type scanline data.
  96.      */
  97.     extern void
  98.     rle_rawtorow( rle_hdr *the_hdr, rle_op **scanraw, int *nraw,
  99.           rle_pixel **outrows );
  100. #else
  101.     /* Return value decls only.  See above for detailed declarations. */
  102.     /* From rle_getraw.c. */
  103.     extern unsigned int rle_getraw();
  104.     extern void rle_freeraw();
  105.     /* From rle_putraw.c. */
  106.     extern void rle_putraw();
  107.     /* From rle_raw_alc.c. */
  108.     extern int rle_raw_alloc();
  109.     extern void rle_raw_free();
  110.     /* From rle_rawrow.c. */
  111.     extern void rle_rawtorow();
  112.  
  113. #endif
  114.  
  115. #endif /* RLE_RAW_H */
  116.